from Tkinter import Menu,messagebox
from Tkinter.ttk import Notebook
 
class baseWindow():
   def __init__(self,window):
       self.window = window
       self.menubar = Menu(self.window)
       self.note = Notebook(self.window)
       self.filemenu = Menu(self.menubar, tearoff=0)
       self.menubar.add_cascade(label='关于', menu=self.filemenu)
       self.help = '联系我'
       self.filemenu.add_command(label=self.help, command=self.showHelp)
       self.init_window()
 
   #设置窗口
   def set_window(self,object = None):
       self.filemenu.add_command(label=object.help, command=object.showHelp)
       self.window.config(menu=self.menubar)
       self.note.add(object.frame, text=object.text)
       self.note.pack()
   #初始窗口
   def init_window(self,x=600,y=330):
       self.window.title('杭州信用卡业务组')           #窗口名
       # 获取屏幕像素，在屏幕中央显示
       screenwidth = self.window.winfo_screenwidth()
       screenheight = self.window.winfo_screenheight()
       self.window.geometry('%dx%d+%d+%d' % (x, y, (screenwidth - x) / 2 - 10, (screenheight - y) / 2 - 40))
       self.window.resizable(width=False, height=False)  # 不可最大化
 
   def showHelp(self):
       textAuthor = 'ST杭州零售测试室信用卡业务组 陈峰'
       messagebox.showinfo(title='author', message=textAuthor)